<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<h1>Create a list</h1>

		<script>
			;(() => {
				const ul = document.createElement('ul')
				document.body.append(ul)

				while (true) {
					let content = prompt('请输入内容')

					if (!content) break

					let li = document.createElement('li')
					li.textContent = content
					ul.append(li)
				}
			})()
		</script>
	</body>
</html>
